package tester;

import java.util.List;
import java.util.Map.Entry;

import src.ClosureType;
import src.Concept;
import src.Context;

/**
 * 
 * @author Patrik Mihalcin
 */
public class ComputingLatticeOfAllFixpointsOfFuzzyClosureOperatorTester {
	public static void main(String[] args) {
		Double[][] relation = { { 1.0, 0.5, 0.5, 1.0, 1.0 },			
							 	{ 1.0, 1.0, 1.0, 1.0, 0.5 }, 
								{ 0.0, 0.0, 0.5, 0.5, 1.0 } };
		Context k = new Context(3, relation);

		k.lattice(ClosureType.UP_DOWN);

		System.out.println("UP DOWN");
		System.out.println("LOWER NEIGHBORS:");
		for (Entry<List<Double>, List<List<Double>>> entry : k.getLowerNeighbors().entrySet()) {
			System.out.println("lower neighbors of " + entry.getKey() + ":");
			System.out.println(entry.getValue());
		}
		System.out.println();
		System.out.println("UPPER NEIGHBORS:");
		for (Entry<List<Double>, List<List<Double>>> entry : k.getUpperNeighbors().entrySet()) {
			System.out.println("upper neighbors of " + entry.getKey() + ":");
			System.out.println(entry.getValue());
		}
		System.out.println();
		System.out.println("CONCEPTS:");
		for (Concept concept : k.getConcepts()) {
			System.out.println(concept);
		}
		
		System.out.println();
		
		k.lattice(ClosureType.DOWN_UP);
		
		System.out.println("DOWN UP");
		System.out.println("LOWER NEIGHBORS:");
		for (Entry<List<Double>, List<List<Double>>> entry : k.getLowerNeighbors().entrySet()) {
			System.out.println("lower neighbors of " + entry.getKey() + ":");
			System.out.println(entry.getValue());
		}
		System.out.println();
		System.out.println("UPPER NEIGHBORS:");
		for (Entry<List<Double>, List<List<Double>>> entry : k.getUpperNeighbors().entrySet()) {
			System.out.println("upper neighbors of " + entry.getKey() + ":");
			System.out.println(entry.getValue());
		}
		System.out.println();
		System.out.println("CONCEPTS:");
		for (Concept concept : k.getConcepts()) {
			System.out.println(concept);
		}
	}
}
